
export default class Talk {
    constructor(socket) {
        this.socket = socket;
    }
    /* talk类型发送消息时执行*/
    sendMessage(msg) {//msg={head:'',body:''}
        //msg
        // console.log("sendMessage", msg.client.sendStatus);
        this.socket.talkObject.addChat(msg.body.talk_id, msg);

    }
    /*收到服务器回执信息的处理*/
    receiptMsg(msg) {//msg.body.data
        // console.log("收到回执消息了！", data);
        // talkObject.changeMessageStatus();
        return msg.body;

    }
    /* */
    getMsg(msg) {//msg={head:'',body:''}
        //2.添加到历史记录
        this.socket.talkObject.addChat(msg.body.talk_id, msg, () => {
            const fetchTalkDetailsMessage = this.socket.sendController.sendServerMsg('getTalkDetail',
                { talk_id: msg.body.talk_id }, this.socket.talkObject.member_id);
            // console.log(fetchTalkDetailsMessage);
            this.socket.sendController._sendMessage(fetchTalkDetailsMessage.data.data.head.clientMsgId);
        });
    }
}